package iface

import "net"

type ISession interface {
	// Start 启动
	Start()
	// Stop 停止
	Stop()
	// GetTcpConn conn
	GetTcpConn() *net.TCPConn
	// GetID id
	GetID() uint32
	// RemoteAddr remote Addr
	RemoteAddr() net.Addr
	// 发送消息 (无缓冲)
	SendMsg(msgId uint32, data []byte) error
	// 发送消息 (有缓冲)
	SendBuffMsg(msgId uint32, data []byte) error
}

/*
消息处理方法
*/
type Handler func(*net.TCPConn, []byte, int) error
